#include "Matrix4.h"

class Viewport {
 public:
	Viewport(double x0, double x1, double y0, double y1) 
		: mat(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
		{
		// Scale
		mat.m[0][0] = (x1-x0)/2.0;
		mat.m[1][1] = (y1-y0)/2.0;
		mat.m[2][2] = 0.5;

		// Translation
		mat.m[0][3] = (x0+x1)/2.0;
		mat.m[1][3] = (y0+y1)/2.0;
		mat.m[2][3] = 0.5;
		
		// Last component
		mat.m[3][3] = 1.0;
	}

	Matrix4 mat;
};
